#ifndef AUTOFREE_H
#define AUTOFREE_H

#include <stdlib.h>

static inline void
g_autoptr_cleanup_generic_gfree (void *p)
{
  void **pp = (void**)p;
  free (*pp);
}

#define _GLIB_CLEANUP(func)               __attribute__((cleanup(func)))
#define g_autofree _GLIB_CLEANUP(g_autoptr_cleanup_generic_gfree)


#endif // AUTOFREE_H
